<?php if (!defined('THINK_PATH')) exit();?>﻿<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="utf-8" />
		<title>文章管理 - FCMS后台管理</title>
				<meta name="keywords" content="" />
		<meta name="description" content="" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<!-- basic styles -->
		<link href="/fcms/Public/assets/css/bootstrap.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="/fcms/Public/assets/css/font-awesome.min.css" />

		<!--[if IE 7]>
		  <link rel="stylesheet" href="/fcms/Public/assets/css/font-awesome-ie7.min.css" />
		<![endif]-->

		<!-- page specific plugin styles -->

		<!-- fonts -->

		<!-- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,300" /> -->

		<!-- ace styles -->

		<link rel="stylesheet" href="/fcms/Public/assets/css/ace.min.css" />
		<link rel="stylesheet" href="/fcms/Public/assets/css/ace-rtl.min.css" />
		<link rel="stylesheet" href="/fcms/Public/assets/css/ace-skins.min.css" />
		<link rel="stylesheet" href="/fcms/Public/assets/css/fcms.css" />

		<!--[if lte IE 8]>
		  <link rel="stylesheet" href="/fcms/Public/assets/css/ace-ie.min.css" />
		<![endif]-->

		<!-- inline styles related to this page -->

		<!-- ace settings handler -->

		<script src="/fcms/Public/assets/js/ace-extra.min.js"></script>

		<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

		<!--[if lt IE 9]>
		<script src="/fcms/Public/assets/js/html5shiv.js"></script>
		<script src="/fcms/Public/assets/js/respond.min.js"></script>
		<![endif]-->

	</head>

	<body>
		


		<div class="wrap">
			<div class="col-xs-12">

				<div class="table-responsive">
					<table id="sample-table-2" class="table table-striped table-bordered table-hover">
						<thead>
							<tr>
								<th class="center">
									<label>
										<input type="checkbox" class="ace" />
										<span class="lbl"></span>
									</label>
								</th>
								<th>标题</th>
								<th>类型</th>
								<th class="hidden-480">作者</th>
								<!--<th class="hidden-480">
									<i class="icon-time bigger-110 hidden-480"></i>
									发布时间
								</th>-->
								<th>
									<i class="icon-time bigger-110 hidden-480"></i>
									最后修改时间
								</th>
								<th>状态</th>
								<th>操作</th>
							</tr>
						</thead>

						<tbody>
							<?php if(is_array($list)): foreach($list as $key=>$vo): ?><tr>
									<td class="center">
										<label>
											<input type="checkbox" name="id" class="ace" value="<?php echo ($vo["id"]); ?>" />
											<span class="lbl"></span>
										</label>
									</td>

									<td>
										<a href="<?php echo U('edit','a_id='.$vo['id']);?>">
											<!-- <?php echo (mb_strlen($vo["title"],'utf8')); ?> -->
											<?php if((mb_strlen($vo['title'],'utf8') > 25)): echo (msubstr($vo["title"],0,25,'UTF-8',true)); ?>
											<?php else: echo ($vo["title"]); endif; ?>
										</a>
									</td>
									<td>
										<?php if(is_array($types)): foreach($types as $key=>$type): if($vo['type'] == $type['id']): echo ($type["name"]); endif; endforeach; endif; ?>
									</td>
									<td class="hidden-480"><?php echo ($vo["a_name"]); ?></td>
									<!--<td class="hidden-480"><?php echo ($vo["create_time"]); ?></td>-->
									<td><?php echo ($vo["last_time"]); ?></td>
									<td>
										<?php if($vo['status'] == 1): ?><span class="label label-sm label-success">可见</span>
										<?php else: ?>
											<span class="label label-sm label-warning">不可见</span><?php endif; ?>
									</td>


									<td>
										<div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
											<a class="blue" title="预览" href="<?php echo U('Home/Index/detail','a_id='.$vo['id']);?>" target="_blank">
												<i class="icon-zoom-in bigger-130"></i>
											</a>
											<?php if($vo['status'] == 1): ?><a class="orange" title="改为不可见"  href="<?php echo U('updateStatus','id='.$vo['id']);?>">
													<i class="icon-eye-close bigger-120"></i>
												</a>
											<?php else: ?>
												<a class="green" title="改为可见" class="btn btn-xs btn-success" href="<?php echo U('updateStatus','id='.$vo['id']);?>">
													<i class="icon-eye-open bigger-120"></i>
												</a><?php endif; ?>

											<a class="blue" title="编辑" href="<?php echo U('edit','a_id='.$vo['id']);?>">
												<i class="icon-pencil bigger-130"></i>
											</a>

											<a class="red"  title="删除" href="#">
												<i class="icon-trash bigger-130"></i>
											</a>
										</div>

										<div class="visible-xs visible-sm hidden-md hidden-lg">
											<div class="inline position-relative">
												<button class="btn btn-minier btn-yellow dropdown-toggle" data-toggle="dropdown">
													<i class="icon-caret-down icon-only bigger-120"></i>
												</button>

												<ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">
													<li>
														<a href="#" class="tooltip-info" data-rel="tooltip" title="View">
															<span class="blue">
																<i class="icon-zoom-in bigger-120"></i>
															</span>
														</a>
													</li>

													<li>
														<a href="#" class="tooltip-success" data-rel="tooltip" title="Edit">
															<span class="green">
																<i class="icon-edit bigger-120"></i>
															</span>
														</a>
													</li>

													<li>
														<a href="#" class="tooltip-error" data-rel="tooltip" title="Delete">
															<span class="red">
																<i class="icon-trash bigger-120"></i>
															</span>
														</a>
													</li>
												</ul>
											</div>
										</div>
									</td>
								</tr><?php endforeach; endif; ?>
						</tbody>
					</table>
				</div>
			</div>
		</div>

		<!-- basic scripts -->

		<script type="text/javascript">
			window.jQuery || document.write("<script src='/fcms/Public/assets/js/jquery-2.0.3.min.js'>"+"<"+"/script>");
		</script>

		<!-- <![endif]-->


		<script type="text/javascript">
			if("ontouchend" in document) document.write("<script src='/fcms/Public/assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
		<script src="/fcms/Public/assets/js/bootstrap.min.js"></script>
		<script src="/fcms/Public/assets/js/typeahead-bs2.min.js"></script>

		<!-- page specific plugin scripts -->

		<script src="/fcms/Public/assets/js/jquery.dataTables.min.js"></script>
		<script src="/fcms/Public/assets/js/jquery.dataTables.bootstrap.js"></script>

		<!-- ace scripts -->

		<script src="/fcms/Public/assets/js/ace-elements.min.js"></script>
		<script src="/fcms/Public/assets/js/ace.min.js"></script>

		<!-- inline scripts related to this page -->

		<script type="text/javascript">
			jQuery(function($) {
				var oTable1 = $('#sample-table-2').dataTable( {
				"aoColumns": [
			      { "bSortable": false },
			      null, null,null, null, null,
				  { "bSortable": false }
				] } );
				
				
				$('table th input:checkbox').on('click' , function(){
					var that = this;
					$(this).closest('table').find('tr > td:first-child input:checkbox')
					.each(function(){
						this.checked = that.checked;
						$(this).closest('tr').toggleClass('selected');
					});
						
				});
			
			
				$('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});
				function tooltip_placement(context, source) {
					var $source = $(source);
					var $parent = $source.closest('table')
					var off1 = $parent.offset();
					var w1 = $parent.width();
			
					var off2 = $source.offset();
					var w2 = $source.width();
			
					if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
					return 'left';
				}
			})
		</script>

</body>
</html>